package com.twu.biblioteca.domain;

public class Movie implements LibraryItem {

    private final String id;
    private final String title;
    private final int year;
    private final String director;
    private final Rating rating;

    public Movie(String id, String title, int year, String director, Rating rating) {
        this.id = id;
        this.title = title;
        this.year = year;
        this.director = director;
        this.rating = rating;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getType() {
        return "movie";
    }

    @Override
    public String getName() {
        return title;
    }

    public static String getHeader() {
        return "Movie, Year, Director, Rating";
    }

    @Override
    public String toString() {
        return String.format("%s, %s, %s, %s", title, year, director, rating.toString());
    }

}
